#ifndef __CONTRACT_H__
#define __CONTRACT_H__

#include "GlobalDef.h"
#include <list>

class ContractInfo {
public:
	b2Fixture *fixtureA;
	b2Fixture *fixtureB;
	bool operator==(const ContractInfo& other)const
	{
		return fixtureA == other.fixtureA && fixtureB == other.fixtureB;
	}
};

class ContractListener : public b2ContactListener {
public:
	ContractListener();
	~ContractListener();
	virtual void BeginContact(b2Contact* contact);
	virtual void EndContact(b2Contact* contact);
	virtual void PreSolve(b2Contact* contact, const b2Manifold* oldManifold);
	virtual void PostSolve(b2Contact* contact, const b2ContactImpulse* impulse);

public:

	list<ContractInfo> contractList;
};

#endif // __CONTRACT_H__